package com.bdqn.t350.ch01.controller;

import com.bdqn.t350.ch01.pojo.User;
import com.bdqn.t350.ch01.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class UserController {

    @Resource
    UserService userService;

    @Resource(name = "zhangsan")
    User user;

    @RequestMapping("/add")
    public Object add(String name) {
        System.out.println(user);
        System.out.println(name);
        User user = new User();
        user.setName(name);
        userService.addBiz(user);
        return "hello:" + name;
    }
}
